<%@page language="java" contentType="text/html; charset=utf-8"%>
<%@include file="/commons/inc.jsp" %>

<h3 id="navTitleId">体格测试</h3>
<script>

function showtips(tips,flag){ 
	var tip=document.getElementById(tips);
	if(tip.style.display=="none"){ 
	        tip.style.display="inline";
	        //my_tips.style.left=event.clientX+10; 
	        //my_tips.style.top=event.clientY+10; 
	}else{ 
	      tip.style.display="none"; 
	} 
}
</script>
<body id="body">

<%@include file="/commons/showmessage.jsp" %>

<form name="labphyform" id="labphyform" method="post" action="${contextPath}/lab/lab.action?method=saveEditLabPhy">
	<s:hidden name="labphy.physicalid" id="labphy.physicalid"></s:hidden>
	<s:hidden name="labphy.patientid" id="labphy.patientid"></s:hidden>
	<s:hidden name="patientid" id="patientid"></s:hidden>
	<s:hidden name="style" id="style"></s:hidden>
	
	<table border="0" cellspacing="1" cellpadding="0" class="formTable" width="100%" >
	<tbody>
		<tr>
			<td align="left" class="form-td" colspan="8"><b>体格检查</b>
			<br><a onclick="showtips('15-1',1);">【说明】
			<br><img id='15-1' style="display:none" src="../images/tips/15.png" />
			</a>
			</td>
		</tr>
		<tr>
			<td align="left" class="form-td"><label class="label">身高:</label></td>
			<td align="left" class="form-td"><input type="text" name="labphy.height" id="labphy.height" size="5" value="${labphy.height}" onChange="javascript:bmi();"/>cm</td>	
			<td align="left" class="form-td"><label class="label">体重:</label></td>
			<td align="left" class="form-td"><input type="text" name="labphy.weight" id="labphy.weight" size="5" value="${labphy.weight}" onChange="javascript:bmi();"/>kg</td>
			<td align="left" class="form-td"><label class="label">体质指数(BMI):</label></td>
			<td align="left" class="form-td"><input type="text" name="labphy.bmi" id="labphy.bmi" size="5" readonly="readonly" value="${labphy.bmi}"/></td>
			<td align="left" class="form-td"><label class="label">体型:</label></td>
			<td align="left" class="form-td">
				<select name="labphy.style" id="labphy.style" disabled="disabled">
					<option value="0" <s:if test="labphy.style == 0">selected</s:if>>正常</option>
					<option value="1" <s:if test="labphy.style == 1">selected</s:if>>消瘦</option>
					<option value="2" <s:if test="labphy.style == 2">selected</s:if>>超重</option>
					<option value="3" <s:if test="labphy.style == 3">selected</s:if>>肥胖</option>
				</select></td>
		 </tr>
		<tr>
			<td align="left" class="form-td"><label class="label">腰围:</label></td>
			<td align="left" class="form-td"><input type="text" name="labphy.waistline" id="labphy.waistline" size="5" value="${labphy.waistline}" onChange="javascript:whr();"/>cm</td>
			<td align="left" class="form-td"><label class="label">臀围:</label></td>
			<td align="left" class="form-td"><input type="text" name="labphy.hip" id="labphy.hip"  size="5" value="${labphy.hip}" onChange="javascript:whr();"/>cm</td>
			<td align="left" class="form-td"><label class="label">腰臀比(WHR):</label></td>
			<td align="left" class="form-td"><input type="text" name="labphy.whr" id="labphy.whr" size="5" value="${labphy.whr}"/></td>
			<td align="left" class="form-td" colspan="2"><label class="label">血压:</label>
				<input type="text" name="labphy.pressurea" id="labphy.pressurea" size="5" value="${labphy.pressurea}"/>
				/<input type="text" name="labphy.pressureb" id="labphy.pressureb" size="5" value="${labphy.pressureb}"/>mmHg</td>
		</tr>
		 
		<tr>
			<td align="left" class="form-td"><label class="label">足背动脉搏动:</label></td>
			<td align="left" class="form-td"><select name="labphy.arterya" id="labphy.arterya">
					<option value="0" <s:if test="labphy.arterya == 0">selected</s:if>>请选择</option>
					<option value="1" <s:if test="labphy.arterya == 1">selected</s:if>>正常</option>
					<option value="2" <s:if test="labphy.arterya == 2">selected</s:if>>减弱</option>
					<option value="3" <s:if test="labphy.arterya == 3">selected</s:if>>消失</option>
				</select></td>
			<td align="left" class="form-td"><label class="label">胫后动脉搏动:</label></td>
			<td align="left" class="form-td" colspan="5"><select name="labphy.arteryb" id="labphy.arteryb">
					<option value="0" <s:if test="labphy.arteryb == 0">selected</s:if>>请选择</option>
					<option value="1" <s:if test="labphy.arteryb == 1">selected</s:if>>正常</option>
					<option value="2" <s:if test="labphy.arteryb == 2">selected</s:if>>减弱</option>
					<option value="3" <s:if test="labphy.arteryb == 3">selected</s:if>>消失</option>
				</select></td>
		</tr>
	 
		<tr>
			<td align="left" class="form-td" colspan="8"><b>身体成分评定</b></td>
		</tr>
		
		<tr>
				<td align="left" class="form-td"><label class="label">细胞内液:</label></td>
				<td align="left" class="form-td"><input type="text" name="labphy.xibaonei" id="labphy.xibaonei" size="5" value="${labphy.xibaonei}"/>Kg</td>
				<td align="left" class="form-td"><label class="label">细胞外液:</label></td>
				<td align="left" class="form-td"><input type="text" name="labphy.xibaowai" id="labphy.xibaowai" size="5" value="${labphy.xibaowai}"/>Kg</td>
				<td align="left" class="form-td"><label class="label">身体总水分:</label></td>
				<td align="left" class="form-td"><input type="text" name="labphy.zongshui" id="labphy.zongshui" size="5" value="${labphy.zongshui}"/>Kg</td>
				<td align="left" class="form-td"><label class="label">指定骨量:</label></td>
				<td align="left" class="form-td"><input type="text" name="labphy.guliang" id="labphy.guliang" size="5" value="${labphy.guliang}"/>Kg</td>
		</tr>
		<tr>
				<td align="left" class="form-td"><label class="label">蛋白质量:</label></td>
				<td align="left" class="form-td"><input type="text" name="labphy.danbai" id="labphy.danbai" size="5" value="${labphy.danbai}"/>Kg</td>
				<td align="left" class="form-td"><label class="label">肌肉量:</label></td>
				<td align="left" class="form-td"><input type="text" name="labphy.jirou" id="labphy.jirou" size="5" value="${labphy.jirou}"/>Kg</td>
				<td align="left" class="form-td"><label class="label">去脂肪体重:</label></td>
				<td align="left" class="form-td"><input type="text" name="labphy.quzhifang" id="labphy.quzhifang" size="5" value="${labphy.quzhifang}"/>Kg</td>
				<td align="left" class="form-td"><label class="label">脂肪量:</label></td>
				<td align="left" class="form-td"><input type="text" name="labphy.zhifang" id="labphy.zhifang" size="5" value="${labphy.zhifang}"/>Kg</td>
		</tr>
		<tr>
				<td align="left" class="form-td"><label class="label">内脏脂肪含量:</label></td>
				<td align="left" class="form-td"><input type="text" name="labphy.neizangzf" id="labphy.neizangzf" size="5" value="${labphy.neizangzf}"/>Kg</td>
				<td align="left" class="form-td"><label class="label">皮下脂肪含量:</label></td>
				<td align="left" class="form-td"><input type="text" name="labphy.pixiazf" id="labphy.pixiazf" size="5" value="${labphy.pixiazf}"/>Kg</td>
				<td align="left" class="form-td"><label class="label">体脂肪率:</label></td>
				<td align="left" class="form-td"><input type="text" name="labphy.tizhifang" id="labphy.tizhifang" size="5" value="${labphy.tizhifang}"/>%
					<select name="labphy.tizhifangs" id="labphy.tizhifangs">
						<option value="0" <s:if test="labphy.tizhifangs == 0">selected</s:if>>请选择</option>
						<option value="1" <s:if test="labphy.tizhifangs == 1">selected</s:if>>低于标准</option>
						<option value="2" <s:if test="labphy.tizhifangs == 2">selected</s:if>>标准</option>
						<option value="3" <s:if test="labphy.tizhifangs == 3">selected</s:if>>高于标准</option>
					</select></td>
				<td align="left" class="form-td"><label class="label">内脏脂肪等级:</label></td>
				<td align="left" class="form-td"><select name="labphy.neizangs" id="labphy.neizangs">
						<option value="0" <s:if test="labphy.neizangs == 0">selected</s:if>>请选择</option>
						<option value="1" <s:if test="labphy.neizangs == 1">selected</s:if>>低于标准</option>
						<option value="2" <s:if test="labphy.neizangs == 2">selected</s:if>>标准</option>
						<option value="3" <s:if test="labphy.neizangs == 3">selected</s:if>>高于标准</option>
					</select></td>
		</tr>
		<tr>
				<td align="left" class="form-td"><label class="label">基础代谢率:</label></td>
				<td align="left" class="form-td"><input type="text" name="labphy.jichudaixie" id="labphy.jichudaixie" size="5" value="${labphy.jichudaixie}"/>kcal</td>
				<td align="left" class="form-td"><label class="label">总能量消耗:</label></td>
				<td align="left" class="form-td" colspan="5"><input type="text" name="labphy.zongnl" id="labphy.zongnl" size="5" value="${labphy.zongnl}"/>kcal</td>
		</tr>
	 
		<tr>
			<td align="left" class="form-td" colspan="8"><b>心肺功能评定</b></td>
		</tr>
		<tr>
				<td align="left" class="form-td"><label class="label">功率:</label></td>
				<td align="left" class="form-td"><input type="text" name="labphy.gonglv" id="labphy.gonglv" size="5" value="${labphy.gonglv}"/>瓦</td>
				<td align="left" class="form-td"><label class="label">心率:</label></td>
				<td align="left" class="form-td"><input type="text" name="labphy.xinlv" id="labphy.xinlv" size="5" value="${labphy.xinlv}"/>次/分</td>
				<td align="left" class="form-td"><label class="label">靶心率:</label></td>
				<td align="left" class="form-td"><input type="text" name="labphy.baxinlv" id="labphy.baxinlv" size="5" value="${labphy.baxinlv}"/>次/分</td>
				<td align="left" class="form-td"><label class="label">心脏功能能力:</label></td>
				<td align="left" class="form-td"><input type="text" name="labphy.xinzang" id="labphy.xinzang" size="5" value="${labphy.xinzang}"/>梅脱</td>
		</tr>
		<tr>
				<td align="left" class="form-td"><label class="label">运动能力:</label></td>
				<td align="left" class="form-td"><input type="text" name="labphy.yundong" id="labphy.yundong" size="5" value="${labphy.yundong}"/>梅脱</td>
				<td align="left" class="form-td"><label class="label">最大摄氧量（相对值）:</label></td>
				<td align="left" class="form-td"><input type="text" name="labphy.sheyangxd" id="labphy.sheyangxd" size="5" value="${labphy.sheyangxd}"/>ml/kg/min</td>
				<td align="left" class="form-td"><label class="label">最大摄氧量（绝对值）:</label></td>
				<td align="left" class="form-td" cospan="3"><input type="text" name="labphy.sheyangjd" id="labphy.sheyangjd" size="5" value="${labphy.sheyangjd}"/>ml/kg/min</td>
		</tr>
		</tbody>
		</table>
	<table>
		<tr>
			<td align="center"> 
			<input type="reset" value="重置"> 
		    <input type="button" onclick="saveEdit('save');" value="保存"></td>
		</tr>
	</table>
</form>

<%@include file="/commons/tableSel.jsp" %>

</body>

<style type="text/css">
body {
	height: 100%;
	width: 100%;
}
</style>

<script>
function saveEdit(type){
	if(type=='refresh'){
		location.reload();
	}else if(type=='save'){
		if(!Validator.Validate($('labphyform'),3)){
			return;
		}	
		$('labphyform').style.value = $('labphy.style').value;
		$('labphyform').submit();
	}
}
function bmi(){
	var a = $('labphy.height').value;
	var b = $('labphy.weight').value;
	if(a!=null && b!=null){
		if(a > 0 && b > 0){
			var r = 100*100*(b/a)/a;
			r = r.toFixed(2);	
			$('labphy.bmi').value = r;
			r = parseFloat(r);
			if(r < 18.5){
				$('labphy.style').value = 1;
				$('labphy.style').options[1].selected=true;//消瘦
			}else if(r <= 23.9){
				$('labphy.style').value = 0;
				$('labphy.style').options[0].selected=true;   //正常
			}else if(r <= 27.9){
				$('labphy.style').value = 2;
				$('labphy.style').options[2].selected=true;   //超重
			}else{
				$('labphy.style').value = 3;
				$('labphy.style').options[3].selected=true;   //肥胖
			}
		}
	}
}
function whr(){
	var a = $('labphy.waistline').value;
	var b = $('labphy.hip').value;
	if(a!=null && b!=null){
		if(a > 0 && b > 0){	
			var q = a/b;
			q = q.toFixed(2);
			$('labphy.whr').value = q;				
		}
	}
}
</script>